public class Test2_thread {
    public static void main(String[] args) {
        System.out.println("主方法的开头");
        MyThread mt=new MyThread();
    }
    static class InnerThread{
        public void run(){
            for (int i=0;i<=100;i++){
                System.out.println("内部类i的值为"+i);
                try{
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
class MyThread extends Thread{
    public void run(){
        for (int i=0;i<=100;i++){
            System.out.println("i的值为"+i);
            try{
                Thread.sleep(1000);
            } catch (InterruptedException e) {
               e.printStackTrace();
            }
        }
    }
}